import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


public abstract class sCard implements Clickable{
	private BufferedImage image;
	protected Hand hand;
	protected int x;
	protected int y;
	protected int dx;
	protected int dy;
	protected boolean isPlayed;
	
	public boolean isPlayed() {
		return isPlayed;
	}

	public void setPlayed(boolean isPlayed) {
		this.isPlayed = isPlayed;
	}

	public sCard(String fileName, Hand hand, int x, int y, int dx, int dy){
		this.hand = hand;
		this.x = x;
		this.y = y;
		this.dx = dx;
		this.dy = dy;
		try {
			image = ImageIO.read(new File(fileName));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public abstract void playCard();
	
	public void removeSelfFromHand(){
//		System.out.println("remove");
		hand.getCards().remove(this);
	}

	public BufferedImage getImage() {
		return image;
	}

	public void setImage(BufferedImage image) {
		this.image = image;
	}
	
}
